package com.shujia.day06.homework.code02;

public class IT {
    // 2.姓名，年龄， 技术方向，工作年限, 工作单位和职务；方法包括：工作
    // 1)设置属性的私有访问权限，通过公有的 get,set 方法实现对属性的访问
    // 限定 IT 从业人员必须年满 15 岁，无效信息需提示，并设置默认年龄为 15
    // 3)限定“技术方向”是只读属性(只提供 get 方法)
    // 4)工作方法通过输入参数，接收工作单位和职务，输出个人工作信息
    private String name;
    private int age;
    private String iTChange;
    private int workingYear;
    private String workingCompany;
    private String job;


    public IT(String name, int age, String iTChange, int workingYear, String workingCompany, String job) {
        this.name = name;
        this.age = age;
        this.iTChange = iTChange;
        this.workingYear = workingYear;
        this.workingCompany = workingCompany;
        this.job = job;
    }

    public void working(){
        System.out.println("姓名："+name);
        System.out.println("年龄："+age);
        System.out.println("技术方向："+getiTChange());
    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if(age < 15){
            System.out.println("年龄信息无效，使用默认值15岁");
        }else {
            this.age = age;
        }
    }

    public String getiTChange() {
        return iTChange;
    }



    public int getWorkingYear() {
        return workingYear;
    }

    public void setWorkingYear(int workingYear) {
        this.workingYear = workingYear;
    }

    public String getWorkingCompany() {
        return workingCompany;
    }

    public void setWorkingCompany(String workingCompany) {
        this.workingCompany = workingCompany;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }
}
